package com.wyz.saas.module.patrol

import com.wyz.saas.common.base.AbstractApiApplication
import com.wyz.saas.module.patrol.bean.repository.PatrolCheckpointRepository
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob

class PatrolModuleApplication(private val application: AbstractApiApplication) {

    companion object {
        lateinit var INSTANCE: PatrolModuleApplication
    }

    init {
        INSTANCE = this
    }

    val scope = CoroutineScope(SupervisorJob())
    val database by lazy { PatrolDatabaseWapper.getDatabase(application) }
    val patrolCheckpointRepository by lazy { PatrolCheckpointRepository(database.patrolCheckpointDao()) }
}